SYSTEMTIME (Structures)
Last changed: -45.137.113.229

.
Summary
Represents a date and time using individual members for the month, day, year, weekday, hour, minute, second, and millisecond.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
private struct SYSTEMTIME {
  [MarshalAs(UnmanagedType.U2)] public short Year;
  [MarshalAs(UnmanagedType.U2)] public short Month;
  [MarshalAs(UnmanagedType.U2)] public short DayOfWeek;
  [MarshalAs(UnmanagedType.U2)] public short Day;
  [MarshalAs(UnmanagedType.U2)] public short Hour;
  [MarshalAs(UnmanagedType.U2)] public short Minute;
  [MarshalAs(UnmanagedType.U2)] public short Second;
  [MarshalAs(UnmanagedType.U2)] public short Milliseconds;

  public SYSTEMTIME( DateTime dt )
  {
    Year = (short)dt.Year;
    Month = (short)dt.Month;
    DayOfWeek = (short)dt.DayOfWeek;
    Day = (short)dt.Day;
    Hour = (short)dt.Hour;
    Minute = (short)dt.Minute;
    Second = (short)dt.Second;
    Milliseconds = (short)dt.Millisecond;
  }
}

VB Definition:

<StructLayout(LayoutKind.Sequential)> _
Private Structure SYSTEMTIME
   <MarshalAs(UnmanagedType.U2)> Public Year As Short
   <MarshalAs(UnmanagedType.U2)> Public Month As Short
   <MarshalAs(UnmanagedType.U2)> Public DayOfWeek As Short
   <MarshalAs(UnmanagedType.U2)> Public Day As Short
   <MarshalAs(UnmanagedType.U2)> Public Hour As Short
   <MarshalAs(UnmanagedType.U2)> Public Minute As Short
   <MarshalAs(UnmanagedType.U2)> Public Second As Short
   <MarshalAs(UnmanagedType.U2)> Public Milliseconds As Short
End Structure

Notes:

Sometimes, when trying to transform this struct into a CLR DateTime, I noticed that the year is 1 year behind. I don't know why.

Tips & Tricks:

Please add some!

Documentation
SYSTEMTIME on MSDN